Skip to content

chore: unify console app base path to /#978

Merged
hotlong merged 3 commits intomainfrom
copilot/update-console-app-base-path
Mar 3, 2026
Merged

chore: unify console app base path to /#978
hotlong merged 3 commits intomainfrom
copilot/update-console-app-base-path

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

Console app Vite base defaulted to /console/ with a VITE_BASE_PATH env override, causing inconsistency between local dev and production. Unified to / everywhere.

Changes

  • apps/console/vite.config.ts — Hardcode base: '/', remove env var override
  • e2e/helpers/index.tsCONSOLE_BASE'' (all E2E URLs now root-relative)
  • apps/console/vercel.json — Drop redundant VITE_BASE_PATH=/ from build command
  • playwright.config.ts — webServer URL /console//
  • apps/console/plugin.ts — JSDoc update
  • ROADMAP.md — P1.16 entry
// before
const basePath = process.env.VITE_BASE_PATH || '/console/';

// after
const basePath = '/';
Original prompt

This section details on the original issue you should resolve

<issue_title>Console app base 路径统一为 /</issue_title>
<issue_description>## 需求

当前 apps/console 的 Vite base 路径在本地调试和生产部署上未统一,默认用 /console/ 前缀。期望统一所有环境,无论本地开发还是生产打包/部署,base 均为 /,不带 /console 前缀。

具体方案:

  1. 修改 apps/console/vite.config.ts
    • base 默认始终设为 /,无论 dev 还是 build。
    • 所有部署、E2E、以及 vercel 配置均统一使用 /
  2. 移除所有对 /console/ base 路径的依赖与多余注释。
    • 包括 e2e/helpers/index.tsCONSOLE_BASE,如需则默认 /
    • 检查 vercel/build 脚本和文档。

建议代码:

// vite.config.ts
export default defineConfig({
  base: '/',
  // ...其他配置
});

相关文件

  • apps/console/vite.config.ts
  • e2e/helpers/index.ts(如有)
  • apps/console/vercel.json
  • 文档及注释

完成后请:

  • 运行测试,确保开发、预览、生产部署均能在 / 主路径下正常访问
  • 更新 ROADMAP.md
  • 关联相关 Issue

如需跨 repo 协作请另建 cross-repo issue。</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@vercel
Copy link

vercel bot commented Mar 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Mar 3, 2026 1:53am
objectui-demo Ready Ready Preview, Comment Mar 3, 2026 1:53am
objectui-storybook Ready Ready Preview, Comment Mar 3, 2026 1:53am

Request Review

Copilot AI and others added 2 commits March 3, 2026 01:47
- vite.config.ts: base path changed from /console/ to /
- e2e/helpers: CONSOLE_BASE changed from /console to empty string
- vercel.json: removed redundant VITE_BASE_PATH=/ override
- playwright.config.ts: webServer url updated to /
- plugin.ts: updated JSDoc comments
- ROADMAP.md: added P1.16 entry

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Update console app base path to unify across environments chore: unify console app base path to / Mar 3, 2026
@hotlong hotlong marked this pull request as ready for review March 3, 2026 02:26
Copilot AI review requested due to automatic review settings March 3, 2026 02:26
@hotlong hotlong merged commit d471d0f into main Mar 3, 2026
4 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Unifies the Console app’s Vite base path to / so local dev, preview/E2E, and Vercel deployments all resolve routes and assets from the root consistently.

Changes:

  • Hardcode Vite base: '/' and remove the VITE_BASE_PATH override path.
  • Update Playwright and E2E helper base URL/path assumptions to be root-relative.
  • Simplify Vercel build command by removing the redundant VITE_BASE_PATH=/ env var.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
playwright.config.ts Updates Playwright webServer URL from /console/ to /.
e2e/helpers/index.ts Switches CONSOLE_BASE to '' to generate root-relative E2E URLs.
apps/console/vite.config.ts Forces Vite base to / (no env override).
apps/console/vercel.json Removes VITE_BASE_PATH=/ from the build command.
apps/console/plugin.ts Updates JSDoc to reflect the new base path.
ROADMAP.md Adds P1.16 entry documenting completion of the base-path unification.

Comment on lines 5 to 9
* HonoServerPlugin auto-discovers this plugin via `type: 'ui-plugin'`
* and mounts it at `/<slug>` (i.e. `/console`).
*
* The SPA must be built with the matching base path:
* VITE_BASE_PATH=/console/ pnpm build
* The SPA is built with base path '/'.
*
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSDoc still states HonoServerPlugin mounts this UI at /<slug> (i.e. /console), but the comment now says the SPA is built with base path '/'. If the plugin is actually served under /console, a '/' base will generate root-absolute asset URLs (e.g. /assets/...) that won’t resolve under /console. Please update the JSDoc to accurately describe the serving path (or document how default=true affects mounting), so the base path and mount path stay consistent.

Copilot uses AI. Check for mistakes.
Comment on lines 4 to +7
* Base path for the console app.
* Matches `base` in `apps/console/vite.config.ts` (defaults to '/console/').
* Matches `base` in `apps/console/vite.config.ts` (always '/').
*/
export const CONSOLE_BASE = '/console';
export const CONSOLE_BASE = '';
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says this matches Vite base (always '/'), but CONSOLE_BASE is set to an empty string. If the intent is “root-relative” URLs, consider updating the comment to clarify why this is '' (or set it to '/' and ensure call sites don’t produce double slashes).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Console app base 路径统一为 /

3 participants